<?php
    $menu_1 = '';
    $menu_2 = '';
    $menu_3 = '';
    $menu_4 = '';
    $menu_5 = '';
    $menu_6 = ' class="active"';
    $menu_7 = '';
    $menu_8 = '';
    include('header.php');
    
    $sql = "SELECT * FROM patents_award WHERE pa_active=1 ORDER BY pa_title";
    $result = $db->Execute($sql);
    $i = 1;
    $docs_list = '';
    while (!$result->EOF)
    {
	$img = '';
	$img_a = '';
	$img_a_ = '';
	if(img_exists(APPPATH.'/files/patents-award',$result->fields['pa_img'])){
	    $img =  'rel="'.SITEURL.'/files/patents-award/'.$result->fields['pa_img'].'"';
	    $img_a = '<a href="'.SITEURL.'/files/patents-award/'.$result->fields['pa_img'].'" target="_blank"'.$img.'>';
	    $img_a_ = '</a>';
	}
	
        if(img_exists(APPPATH.'/files/patents-award',$result->fields['pa_path'])){
            $docs_list .= '<li><a href="'.SITEURL.'/files/patents-award/'.$result->fields['pa_path'].'" target="_blank"'.$img.'>'.$result->fields['pa_title'].'</a></li>';
        }else{
            $docs_list .= '<li>'.$img_a.$result->fields['pa_title'].$img_a_.'</li>';
        }
        
        $result->MoveNext();
    }
    $result->Close();;
?>
	    <div id="main_content">
		
		<div class="page_title" id="history_title">
		    <img src="images/patent_award_title.jpg" alt="Patent &amp; Award" />
		</div>
		
		<div id="content_top">&nbsp;</div>
		<div id="content_center" class="award_content">
		    <ul id="fifth">
		    <?php echo $docs_list; ?>
		    </ul>
		</div>
		<div id="content_bottom">&nbsp;</div>
		
	    </div>
<?php
    include('footer.php');
?>
<script type="text/javascript" src="<?php echo SITEURL; ?>/js/imgpreview.min.0.22.jquery.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
	$('ul#fifth a').imgPreview({
	    containerID: 'imgPreviewWithStyles',
	    /* Change srcAttr to rel: */
	    srcAttr: 'rel'/*,
	    imgCSS: {
		// Limit preview size:
		height: 200
	    },
	    // When container is shown:
	    onShow: function(link){
		$('<span>' + link.html + '</span>').appendTo(this);
	    },
	    // When container hides: 
	    onHide: function(link){
		$('span', this).remove();
	    }*/
	});
    });
</script>
<style>
/* CSS: (StyleSheet) */
#imgPreviewWithStyles {
    background: #666666;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    padding: 5px;
    z-index: 999;
    border: none;
}

/* Text below image */
#imgPreviewWithStyles span {
    color: white;
    text-align: center;
    display: block;
    padding: 10px 0 3px 0;
}
</style>